home *** CD-ROM | disk | FTP | other *** search
/ Aminet 50 / Aminet 50 (2002)(GTI - Schatztruhe)[!][Aug 2002].iso / Aminet / text / edit / tecoc-146.lha / flowec.c < prev    next >
C/C++ Source or Header  |  1991-07-05  |  1KB  |  44 lines

  1. /*****************************************************************************
  2.  
  3.     FlowEC()
  4.  
  5.     This function moves the command string pointer to the next matching
  6. ' character in the command string.  It is called when a F' command is
  7. encountered or when a | character is encountered while a conditional command
  8. string is executing.
  9.  
  10. *****************************************************************************/
  11.  
  12. #include "zport.h"        /* define portability identifiers */
  13. #include "tecoc.h"        /* define general identifiers */
  14. #include "defext.h"        /* define external global variables */
  15. #include "deferr.h"        /* define identifiers for error messages */
  16.  
  17. DEFAULT FlowEC()        /* flow to end of conditional */
  18. {
  19.     WORD    TmpNst;
  20.  
  21.     TmpNst = 1;
  22.     do {
  23.         if (CBfPtr == CStEnd) {
  24.             ErrMsg(ERR_MAP);    /* missing ' */
  25.             return FAILURE;
  26.         }
  27.         ++CBfPtr;
  28.         if (*CBfPtr == '"') {
  29.             ++TmpNst;
  30.         } else if (*CBfPtr == '\'') {
  31.             --TmpNst;
  32.         }
  33.         if (SkpCmd() == FAILURE) {
  34.             return FAILURE;
  35.         }
  36.     } while (TmpNst > 0);
  37.  
  38.     if (TraceM) {
  39.         EchoIt(*CBfPtr);
  40.     }
  41.  
  42.     return SUCCESS;
  43. }
  44.